<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>链接跳转显示二维码</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            background-color: #f0f0f0;
        }

        .chat-container {
            max-width: 600px;
            margin: 20px auto;
            padding: 20px;
        }

        .message-content {
            background-color: white;
            padding: 15px;
            border-radius: 10px;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        }

        .link {
            color: #007bff;
            text-decoration: none;
            display: inline-block;
            margin: 8px 0;
        }

        .link:hover {
            text-decoration: underline;
        }

        /* 模态框样式 */
        .modal {
            display: none; /* 默认隐藏 */
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.7);
            z-index: 1000;
            justify-content: center;
            align-items: center;
        }

        .modal-content {
            background-color: white;
            padding: 30px;
            border-radius: 10px;
            text-align: center;
            position: relative;
            max-width: 80%;
        }

        .close {
            position: absolute;
            top: 10px;
            right: 15px;
            font-size: 24px;
            cursor: pointer;
            color: #999;
        }

        .close:hover {
            color: #333;
        }

        .qr-code {
            max-width: 250px;
            max-height: 250px;
            margin-top: 10px;
        }
    </style>
</head>
<body>
    <div class="chat-container">
        <div class="message-content">
            <p>这个是东哥本人 <span class="up-arrow">⬆</span></p>
            <a href="#qr-code-modal" class="link" id="showQrCode">链接东哥本人</a>
            <p class="description">东哥的直播私域打法分享</p>
            <p class="issue">点击卡片后一直加载不出来😥/ 是空白页面😵 (可能是网络问题) 稍等一会儿或重新点</p>
        </div>
    </div>

    <!-- 二维码模态框 -->
    <div id="qr-code-modal" class="modal">
        <div class="modal-content">
            <span class="close" id="closeModal">&times;</span>
            <h3>扫描二维码联系东哥</h3>
            <img src="https://img0.baidu.com/it/u=600722015,3838115472&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=750" alt="QR Code" class="qr-code">
        </div>
    </div>

    <script>
        // 获取DOM元素
        const modal = document.getElementById('qr-code-modal');
        const showQrCodeBtn = document.getElementById('showQrCode');
        const closeModalBtn = document.getElementById('closeModal');

        // 点击链接显示模态框
        showQrCodeBtn.addEventListener('click', function(e) {
            e.preventDefault(); // 阻止默认跳转行为
            modal.style.display = "flex"; // 改为flex布局
        });

        // 点击关闭按钮隐藏模态框
        closeModalBtn.addEventListener('click', () => {
            modal.style.display = "none";
        });

        // 点击模态框外部隐藏模态框
        window.addEventListener('click', (e) => {
            if (e.target === modal) {
                modal.style.display = "none";
            }
        });
    </script>
</body>
</html>